<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:common="http://java.sun.com/jsf/composite/components/common"
    template="/resources/templates/mainlayout.xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html">

    <ui:define name = "menuRight">
        <div class = "helpNotice" style = "width: 200px;">
            <h1>Help</h1>
            <p>
                Quis placerat libero. Mauris a eros erat, convallis tincidunt nibh. Mauris enim ante, consequat ut ornare eget, interdum et mauris. Morbi eu pharetra risus. Etiam urna dui, consequat in congue id, volutpat vitae orci. Cras eget odio ut metus ultricies pharetra. Quisque euismod feugiat venenatis. Vestibulum ut lectus lectus. Praesent non dui et nisl tempor tempus in vel turpis. Morbi ante velit, convallis vel aliquet quis, vestibulum id neque.
            </p>
            <p>
                Praesent non dui et nisl tempor tempus in vel turpis. Morbi ante velit, convallis vel aliquet quis, vestibulum id neque.
            </p>
        </div>
    </ui:define>

    <ui:define name="content">        
        <div class = "form">
            <f:view>
                <h:form id = "registerForm" styleClass = "niceform">
                    <fieldset>
                        <legend>Register form</legend>
                        <ol>
                            <li>
                                <label for = "registerForm:username">Username(login): </label>
                                <h:inputText id = "username" required = "true" value = "#{registerJSFBean.username}" />
                                <h:message for = "username" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:name">Real name: </label>
                                <h:inputText id = "name" required = "true" value = "#{registerJSFBean.name}" >
                                    <f:validator validatorId="custom.nameValidator"/>
                                </h:inputText>
                                <h:message for = "name" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:surname">Surname: </label>
                                <h:inputText id = "surname" required = "true" value = "#{registerJSFBean.surname}" >
                                    <f:validator validatorId="custom.nameValidator"/>
                                </h:inputText>
                                <h:message for = "surname" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:birthDate">Birth date (dd/mm/yyyy): </label>
                                <h:inputText required = "true" id="birthDate" value="#{registerJSFBean.birthDate}">
                                    <f:convertDateTime pattern="DD/MM/yyyy"/>
                                </h:inputText>
                                <h:message for = "birthDate" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:email">Email: </label>
                                <h:inputText required = "true" id = "email" value = "#{registerJSFBean.email}" >
                                    <f:validator validatorId="custom.emailValidator"/>
                                </h:inputText>
                                <h:message for = "email" styleClass = "errorNotice" showDetail = "true"/>
                            </li>
                            <li>
                                <label for = "registerForm:email2">Retype email: </label>
                                <h:inputText required = "true" id = "email2" value = "#{registerJSFBean.email2}" >
                                </h:inputText>
                                <h:message for = "email2" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:password">Password: </label>
                                <h:inputSecret id = "password" required = "true" redisplay = "true" value = "#{registerJSFBean.password}" >
                                    <f:validator validatorId="custom.passwordValidator"/>
                                </h:inputSecret>
                                <h:message for = "password" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                            <li>
                                <label for = "registerForm:password2">Retype password:</label>
                                <h:inputSecret id = "password2" required = "true" redisplay = "true" value = "#{registerJSFBean.password2}"/>
                                <h:message for = "password2" styleClass = "errorNotice" showDetail = "true" />
                            </li>
                        </ol>
                    </fieldset>
                    <fieldset class = "control">
                        <h:commandButton action = "#{registerJSFBean.register}" value = "Register" title = "Register" type = "submit" />
                    </fieldset>
                </h:form>
            </f:view>
        </div>
    </ui:define>

</ui:composition>

<!--
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:common="http://java.sun.com/jsf/composite/components/common">
    <h:head>
        <title>Login to rescriptus</title>
    </h:head>

    <h:body>
        <f:view>
            <common:menutop title = "Main Page" />
            <center>
                <div class = "form" >
                    <form action = "j_security_check">
                        <label for = "username" >Username: </label><input id = "username" type = "text" name = "j_username" /><br/>
                        <label for = "password" >Password: </label><input id = "password" type = "password" name = "j_password" /><br/>
                        <input type = "submit" id = "submit" title = "Zaloguj" >Zaloguj</input>
                    </form>
                </div>
            </center>
        </f:view>
    </h:body>
</html>

-->